package com.yw.smartcity_study;

import com.yw.smartcity_study.api.Api;

import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

public class ServiceCreator {

    private  static  ServiceCreator instance = new ServiceCreator();
    //public String baseUrl = "http://124.93.196.45:10001";
    private Retrofit retrofit;
    public static ServiceCreator getInstance() {
        return instance;
    }

    private ServiceCreator(){
        retrofit = new Retrofit.Builder()
                .baseUrl(App.baseUrl)
                .addConverterFactory(GsonConverterFactory.create())
                .build();
    }

    public Api getApi(){
        return retrofit.create(Api.class);
    }
}
